#include <cairo.h>
#include <gtk/gtk.h>
#include <iostream>
cairo_surface_t *image;
gboolean timer = TRUE;

static gboolean
on_expose_event(GtkWidget *widget,
    GdkEventExpose *event,
    gpointer data)
{
    static int s_time = 0;
    std::cout << s_time++ << std::endl;
    return FALSE;
}


int
main (int argc, char *argv[])
{

  GtkWidget *window;
  GtkWidget *darea;


  gtk_init(&argc, &argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  darea = gtk_drawing_area_new();
  gtk_container_add(GTK_CONTAINER (window), darea);

  g_signal_connect(darea, "expose-event",
      G_CALLBACK(on_expose_event), NULL);
  g_signal_connect(window, "destroy",
      G_CALLBACK(gtk_main_quit), NULL);

  gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
  gtk_window_set_default_size(GTK_WINDOW(window), 300, 300);

  gtk_window_set_title(GTK_WINDOW(window), "fade out");
  gtk_widget_show_all(window);

  gtk_main();



  return 0;
}
